/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author claudialilianaleivadesiguenza
 */

public   class Numeros implements Comparable{
    
    private int num;
    
    public Numeros (int num){
        this.num= num;
    }
    
    public int getNum(){
        return this.num;
    }
    
    @Override
    public int compareTo(Object otherNum){
    
        if(otherNum instanceof Numeros){
            throw new ClassCastException("Numero Invalido");
        }
        Numeros tempNum= (Numeros)otherNum;
        
        if (this.getNum() > tempNum.getNum()){
            return 1;
            
        
        }else if (this.getNum()< tempNum.getNum()){
            return -1;
        }else{
            return 0;
        }
    }
}
